package com.mida.app.report.service.impl;

import com.mida.app.report.service.DocKnwConceptualService;
import com.mida.dms.knw.api.KnwReportApi;
import com.mida.dms.knw.entity.KnwConceptualDetail;
import com.mida.tool.common.result.ListResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Slf4j
@Transactional
public class DocKnwConceptualServiceImpl implements DocKnwConceptualService {

    /**
     * KnwReportApi
     */
    @Autowired
    private KnwReportApi knwReportApi;

    /**
     * @param conceptualSoid
     * @return
     */
    @Override
    public ListResult<List<KnwConceptualDetail>> findAllByConceptSoid(Long conceptualSoid) {
        ListResult<List<KnwConceptualDetail>> result = knwReportApi.findAllByConceptSoid(conceptualSoid);
        return result;
    }

    /**
     * @param conceptualDetailSoid
     * @return
     */
    @Override
    public ListResult<KnwConceptualDetail> findByConceptualDetailSoid(Long conceptualDetailSoid) {
        ListResult<KnwConceptualDetail> result =
                knwReportApi.findByConceptualDetailSoid(conceptualDetailSoid);
        return result;
    }
}
